﻿Namespace BL

    Public Module TapeColors


#Region "TapeColors_DML"

        Public Function InsertTapeColor(dict As Dictionary(Of String, Object)) As Integer
            Return DDA.Insert("TapeColors", dict)
        End Function

        Public Function UpdateTapeColor(dict As Dictionary(Of String, Object), TapeColorID As Integer) As Integer
            Return DDA.Update("TapeColors", dict, "TapeColorID=" & TapeColorID)
        End Function

        Public Function DeleteTapeColor(ByVal TapeColorID As Integer) As Integer
            Return DDA.Delete("TapeColors", "TapeColorID=" & TapeColorID, False)
        End Function

#End Region

#Region "TapeColors_Selection"

        Public Function GetAllTapeColors() As IDataReader
            Dim sql As String = "SELECT * FROM TapeColors Order By TapeColor ASC"
            Return DDA.SelectData(sql)
        End Function

        Public Function GetTapeColors(searchFor As String, criteria As String, startRowIndex As Integer, maximumRows As Integer, SortBy As String) As IDataReader
            Dim sql As String
            sql = "SELECT * FROM TapeColors "

            If SortBy = "" Then SortBy = " CreatedDate Desc"

            Return DDA.SelectDataPaginated(sql, startRowIndex, maximumRows, SortBy)
        End Function

        Public Function TapeColorsCount(searchFor As String, criteria As String) As Integer
            Dim sql As String
            sql = "SELECT * FROM TapeColors "
            Return DDA.SelectDataCount(sql)
        End Function

#End Region


    End Module

End Namespace
